package com.frxuexi.mynews.repository

import com.frxuexi.lib_commom.RetrofitManager
import com.frxuexi.mynews.ApiService
import com.frxuexi.mynews.entity.BaseEntity
import com.frxuexi.mynews.entity.VideoDataEntity
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOn

class VideoRepository {
    val apiService by lazy { RetrofitManager.getRetrofit().create(ApiService::class.java) }

    //获取视频列表
    fun getVideos(page:Int):Flow<BaseEntity<VideoDataEntity>>{
        return apiService.getVideos(page).flowOn(Dispatchers.IO)
    }
}